<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ page import="java.lang.*" %>
<%@ page import="java.sql.*" %>
<%@ page import="vlms.bean.Movie"%>
<%@ page session="true" %>

<%
	Movie[] movieList=(Movie[])request.getAttribute("MovieList");
	
	
%>

<html>
<head>
 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
     <link rel="stylesheet" type="text/css" href="jsp/style.css" />
     <script type="text/javascript">
     function validate(){
         
         if(document.Form.search_text.value=="")
         {
      alert("Entry required. Enter keyword to search");
      document.Form.search_text.focus();
      return false;
         }
         return true;
     }
     </script>
 <title>Home</title>
</head>
<body>
  <div id="container">
		<div id="header">
		<center><img src="../../images/video-library-logo-2.jpg" align="center" height="80px" width="250px" alt="" /></center>
        	
        	
        	
        	
             </div>   
         <div id="menu">
        	 <jsp:include page="/jsp/menu.jsp">
  				 <jsp:param name="name" value="sos" />
			</jsp:include>
        	 
        	
        	</div>
       
        
        <div id="leftmenu">

        </div>                 
        
        <div id="content_top"></div>
        <div id="content_main">
          
 <center>
 <form id="Form" name="Form" method="POST" action="SearchMovies" onsubmit="return validate();">
<table>
<BR><BR>
<tr><td>
<H2>Search Movie </H2>
</td></tr>
<tr></tr>
<tr></tr>
<tr></tr>
<tr>
<td>
Search By:
<SELECT NAME="search " id ="search" onchange="">
<OPTION VALUE='movieName'>Movie Name</OPTION>
<OPTION VALUE='movieBanner'>Movie Banner</OPTION>
<OPTION VALUE='movieCategory'>Movie Category</OPTION>
</SELECT> 
</td>
<td>
Search: 

  <input type="text" name="search_text" id="search_text" value="">
  </td>
  <td>

 <input type="submit" name="Submit" value="Search">
 </td></tr>
 <tr height="200px"></tr>
</table>
 </form>
 </center>
   </div>
 
 
            
     <div id="content_bottom"></div>
      <form name="MovieList" method="post" action="">
		<div class="inputColumn" id="movieList"
			style="text-align: center; border: thin; margin: auto;">
			<table border="1">
				
				<%
				if(movieList!=null)
				{
						
						
				%>
				<tr>
					<td align="right">
					<label name="select" style="size: 30;">Select to Perform operation</label>
					</td>
					<td align="right">
					<label name="moviename" style="size: 30;">Movie Name</label>
					</td>
					<td align="right">
					<label name="moviebanner" style="size: 30;">Movie Banner</label>
					</td>
					<td align="right">
					<label name="moviecategory" style="size: 30;">Movie Category</label>
					</td>
					<td align="right">
					<label name="releasedate" style="size: 30;">Release Date</label>
					</td>
					<td align="right">
					<label name="rentamount" style="size: 30;">Rent Amount</label>
					</td>
					
				</tr>
				
				<%
				
				for(Movie movie: movieList)
				{
					if(movie.getCopiesavailable()>0)
					{
				%>
				
				
				<tr bordercolor="red" style="border-style: none" bordercolor="white">
				<td>
				<input type="radio"
						value='<%=movie.getMovieid()%>'
						name="movieId" /></td>
					<td bordercolor="red" bordercolor="white"><label
						name="movieName" style="size: 30;"><%=movie.getMoviename()%></label>
					</td>
					<td bordercolor="red" bordercolor="white"><label
						name="movieBanner" style="size: 30;"><%=movie.getMoviebanner()%></label>
					</td>
					<td bordercolor="red" bordercolor="white"><label
						name="movieCategory" style="size: 30;"><%=movie.getCategory()%></label>
					</td>
					
					
					<td bordercolor="red" bordercolor="white"><label
						name="releaseDate" style="size: 30;"><%=movie.getReleasedate()%></label>
					</td>
					<td bordercolor="red" bordercolor="white"><label
						name="rentAmount" style="size: 30;"><%=movie.getRentamount()%></label>
					</td>
					

				</tr>
				
				
				<%
				}
				}
				
				}
				%>
      </table>
      </div>
      </form>
      
 
</body>
</html>